With enhancement of the calculation capability and the I/O performance of an embedded device, a storage device is used to store a large number of multimedia files. More and more embedded devices can provide multimedia services. Permanent high-capacity memories, such as a secure digital (SD) storage card, a USB universal serial bus (USB) disk, and an external serial advanced technology attachment (SATA) hard disk, are widely used in external storage of embedded multimedia service devices.
A multimedia service program needs to scan a multimedia file and parse the multimedia file to extract directory information, such as a title of the multimedia file, a bookmark and an explanation of the multimedia file. The directory information is used to issue a multimedia content directory. The extracted directory information needs to be stored in a small-sized database, providing for a client to perform browsing and retrieval. The database is called a media service database.
When the directory information of the multimedia file is input in the media service database during a process of scanning the multimedia file, operations such as parsing the multimedia file, storing the directory information in the media service database, and querying the database, need to take a great deal of time. Scanning time directly influences the experience of a customer, and how to improve scanning performance is a focus that needs attention in the development of the embedded multimedia services.
In a solution of the prior art 1, a memory file system is adopted to input data of a media service database. After a device is started each time, the media service database is re-created, a media file is re-scanned to generate directory information, and the directory information is input in the media service database.
However, the solution of the prior art 1 has the following disadvantages: The media service database is lost when the device is powered-off, and the next time it is required to re-create the media service database and scan the media data, so a user needs to wait for a long time. Moreover, the re-scanning may probably change an identification (ID) of the directory information corresponding to the media file, which causes a play list and a bookmark of a client to become invalid and brings failed experience to the user.
In a solution of the prior art 2, an external storage device is adopted to store a media database. Directory information in the media service database can be stored permanently. After a media file is added or deleted, only the media database is updated.
However, in the solution of the prior art 2, the media service database has a poor read-and-write performance, thereby affecting a service response speed. Moreover, the media database is easily damaged due to hot swapping of the external access memory by a user, which results in a running exception of a program.
It can be known from the above that in the solutions of the prior art, when the directory information of the multimedia file is input in the media service database, it is possible that the occurrence of an exception state results in that the directory information in the media service database changes, so that a client program cannot normally use the directory information in the media service database, thereby causing the exception of the program and affecting the experience of the customer.